@echo off
set appDir=%~dp0
set curPath=%path%
7za.exe x -r -y MASM32.7z -o./

if defined lib (
	wmic ENVIRONMENT where "name='lib' and username='<system>'" set VariableValue="%lib%;%appDir%masm32\lib"
) else (
	wmic ENVIRONMENT create name="lib",username="<system>",VariableValue="%appDir%masm32\lib"
)

if defined include (
	wmic ENVIRONMENT where "name='include' and username='<system>'" set VariableValue="%include%;%appDir%masm32\include"
) else (
	wmic ENVIRONMENT create name="include",username="<system>",VariableValue="%appDir%masm32\include"
)

if defined path (
	wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%curPath%;%appDir%masm32\bin"
) else (
	wmic ENVIRONMENT create name="path",username="<system>",VariableValue="%appDir%masm32\bin"
)

@echo on
pause